package com.daidai.activitys

import android.view.GestureDetector
import android.view.MotionEvent
import com.daidai.base.BaseActivity
import com.daidai.spinner.R

class FlingActivity : BaseActivity() {

    var listener = object: GestureDetector.SimpleOnGestureListener() {
        override fun onFling(e1: MotionEvent?, e2: MotionEvent?, velocityX: Float, velocityY: Float): Boolean {
            return false
        }

        override fun onScroll(e1: MotionEvent?, e2: MotionEvent?, distanceX: Float, distanceY: Float): Boolean {
            return true
        }
    }

    lateinit var detector: GestureDetector
    override fun getContentViewResId(): Int = R.layout.activity_fling
    override fun initView() {
        detector = GestureDetector(this, listener)
    }

    override fun initData() {
    }

    override fun onTouchEvent(event: MotionEvent?): Boolean {
        return detector.onTouchEvent(event)
    }

    //-------------------------------------------------------

}